package net.airtheva.uniqueTask4;

import android.content.ComponentName;
import android.content.ServiceConnection;
import android.os.IBinder;
import android.util.Log;

public class PlayerServiceConnection implements ServiceConnection {

		public static final String TAG = "PlayerServiceConnection";
	
		interface OnServiceConnectedListener {
			
			void OnServiceConnected(IBinder service);
			
		}
		
		OnServiceConnectedListener mOnServiceConnectedListener;
		
		@Override
		public void onServiceConnected(ComponentName name, IBinder service) {
			// TODO Auto-generated method stub
			Log.d(TAG, "onServiceConnected.");
			
			if(mOnServiceConnectedListener != null) {
				mOnServiceConnectedListener.OnServiceConnected(service);
			}
			
		}

		@Override
		public void onServiceDisconnected(ComponentName name) {
			// TODO Auto-generated method stub
			Log.d(TAG, "onServiceDisconnected.");
		}
		
		public void SetOnServiceConnectedListener(OnServiceConnectedListener l) {
			
			mOnServiceConnectedListener = l;
			
		}
		
}
